﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace App {

    public class UsualSuspect {
        public string Name { get; set; }
        public int TagWidth { get; set; }
        public int HeadWidth { get; set; }
        public string Pic { get { return Name + ".png"; }}
    }

    public partial class Main {
    
        public List<UsualSuspect> UsualSuspects { get; set; }

        readonly string[] Names = new[] { "Chris", "Eddy", "JP", "Lisa", "Mike" };
        readonly int[] TagsWidth = new[] { 230, 239, 390, 338, 280 };
        readonly int[] HeadWidth = new[] { 200, 255, 390, 338, 275 };
    
        public Main() {
        
            RoundUpTheUsualSuspects();    
            InitializeComponent();
        }

        void RoundUpTheUsualSuspects() {
            var SuspectNames = Names.ToList();
            var RandomGenerator = new Random();

            UsualSuspects = new List<UsualSuspect>();

            while (SuspectNames.Count > 0) {
                var SuspectIndex = RandomGenerator.Next(0, SuspectNames.Count);
                AddUsualSuspect(SuspectNames[SuspectIndex]);
                SuspectNames.RemoveAt(SuspectIndex);
            }
        }

        void AddUsualSuspect(string Name) {
            var SuspectNo = UsualSuspects.Count;
            
            UsualSuspects.Add(new UsualSuspect {
                Name = Name, 
                TagWidth = TagsWidth[SuspectNo],
                HeadWidth = HeadWidth[SuspectNo],
            });
        }
    }
}